package day13;

import java.io.*;

/**
 * @author Xiao
 * @date 2021/8/4
 */
public class ConverterStreamDemo01 {
    /**
     * 用字符流读取当前包下的cc.txt文件（编码格式GBK），写到ee.txt文件中，指定编码格式GBK
     */
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream(
                "classpractice\\src\\day13\\cc.txt"),"gbk");
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(
                "classpractice\\src\\day13\\ee.txt"));
        int read;
        while ((read = isr.read()) != -1) {
            osw.write(read);
        }
        isr.close();
        osw.close();
    }
}
